home *** CD-ROM | disk | FTP | other *** search
- //activeBreadboard. lockWindowUpdate()
- //
- // This macro creates the standard linear regression breadboard
- //
- subtitleTextBox. setText ("")
- mainTextBox. setText ("")
- //
- // drop down input axon and file icon
- //
- activeBreadboard. setAnimatePoint ( 20 , 225 )
- activeBreadboard. stampAndMove ( "Axon" , "inputAxon" )
- inputAxon. setRows ( 1 )
- activeBreadboard. stampOnAndMove ( "File" , "inputAxon" )
- file. setName ("inputFile")
- inputFile. setActiveAccessPoint ( "Pre-Activity" )
- inputFilePath = macro. pathFromMacro ( "regression input.asc" )
- inputFile. addFile ( inputFilePath , FALSE )
- inputFile. setActiveTranslatorName ( "ASCII - Column" , FALSE )
- inputFile. setNormalize ( FALSE )
- inputFile. translate ( )
- //
- // put down synapse and bias axon
- //
- activeBreadboard. setAnimatePoint ( 110 , 225 )
- activeBreadboard. stampAndMove ( "FullSynapse" , "hidden1Synapse" )
- inputAxon. connectTo ( "hidden1Synapse" )
- activeBreadboard. setAnimatePoint ( 200 , 225 )
- activeBreadboard. stampAndMove ( "Axon" , "outputAxon" )
- outputAxon. setRows ( 1 )
- hidden1Synapse. connectTo ( "outputAxon" )
- //
- // put down controller
- //
- activeBreadboard. setAnimatePoint ( 15 , 200 )
- activeBreadboard. stampAndMove ( "StaticControl" , "control" )
- control. setEpochs ( 1 )
- activeBreadboard. stampOnAndMove ( "DataStorage" , "inputAxon" )
- dataStorage. setName("inputActivityStorage")
- activeBreadboard. stampOnAndMove ( "ScatterPlot" , "inputActivityStorage" )
- scatterPlot. setName("inputActivityScatterPlot")
- activeBreadboard. stampOnAndMove ( "DataStorageTransmitter" , "outputAxon" )
- dataStorageTransmitter. setName("outputActivityTransmitter")
- outputActivityTransmitter. setActiveAccessPoint ( "Activity" )
- outputActivityTransmitter. toggleConnection ( "inputActivityStorage" , "attachToBuffer" )
- //
- // add l2 and viewer
- //
- activeBreadboard. setAnimatePoint ( 310 , 225 )
- activeBreadboard. stampAndMove ( "L2Criterion" , "criterion" )
- outputAxon. connectTo ( "criterion" )
- activeBreadboard. stampOnAndMove ( "File" , "criterion" )
- file. setName(desiredFile)
- desiredFile. setActiveAccessPoint ( "Desired Signal" )
- desiredFilePath = macro. pathFromMacro ( "regression desired.asc" )
- desiredFile. addFile (desiredFilePath , FALSE )
- activeBreadboard. select ( "desiredFile" , FALSE )
- desiredFile. setNormalize ( FALSE )
- activeBreadboard. stampOnAndMove ( "DataStorageTransmitter" , "desiredFile" )
- dataStorageTransmitter. toggleConnection ( "inputActivityStorage" , "attachToBuffer" )
- //
- // add scatter plot
- //
- inputActivityStorage. setMessageEvery ( 12 )
- inputActivityStorage. setBufferLength ( 12 )
-
- inputActivityScatterPlot. openEngineWindow ( )
- inputActivityScatterPlot. setXMaxScale (12.0000 )
- inputActivityScatterPlot. setXMinScale ( -1.0000 )
- inputActivityScatterPlot. setYMaxScale ( 10.000000 )
- inputActivityScatterPlot. setYMinScale ( -10.000000 )
- inputActivityScatterPlot. setBroadcast ( TRUE )
- inputActivityScatterPlot. setDotSize ( 3 )
- inputActivityScatterPlot. setBroadcast ( FALSE )
- inputActivityScatterPlot. setActiveChannel ( 2 )
- inputActivityScatterPlot. setVisible ( TRUE )
- inputActivityScatterPlot. setActiveChannel ( 1 )
- inputActivityScatterPlot. setVisible ( TRUE )
- inputActivityScatterPlot. setActiveChannel ( 0 )
- inputActivityScatterPlot. setVisible ( FALSE )
- inputActivityScatterPlot. setFixWindowTitle ( TRUE )
- inputActivityScatterPlot. setWindowTitle ( "Input Data (red) and Regression Line (blue)" )
- inputActivityScatterPlot. tileWindow(1,3,3,3)
- //
- activeBreadboard. stampOnAndMove ( "MatrixViewer" , "criterion" )
- matrixViewer. setName(costViewer)
- costViewer. setActiveAccessPoint ( "Average Cost" )
- costViewer. setEnableLabels ( TRUE )
- costViewer. setAccessRows(FALSE)
- costViewer. setLabel ( "Mean Squared Error" )
- costViewer. setAccessRows ( TRUE )
- costViewer. setLabel ( "" )
- costViewer. openEngineWindow ( )
- costViewer. tileWindow(4,4,5,6)
-
- activeBreadboard. select ( NULL, FALSE )
-
- //
- // add viewers
- //
- activeBreadboard. stampOnAndMove ( "MatrixViewer" , "hidden1Synapse" )
- matrixViewer. setName ( "weightViewer" )
- weightViewer. setActiveAccessPoint ( "Weights" )
- weightViewer. setEnableLabels ( TRUE )
- weightViewer. setLabel ( "w" )
- weightViewer. setAccessRows ( FALSE )
- weightViewer. setLabel ( "Weight" )
- weightViewer. openEngineWindow ( )
-
- weightViewer. tileWindow(4,4,5,6)
- costViewer. tileWindow(4,4,6,6)
-
- //
- // set initial conditions
- //
- hidden1Synapse. setWeightMean (1 )
- hidden1Synapse. setWeightVariance ( 0 )
- hidden1Synapse. networkRandomize ( )
- control. setEpochs ( 100 )
- control. resetNetwork ( )
- control. runNetwork ( )
- //
- // add backprop layer
- //
- activeBreadboard. stampOnAndMove ( "BackStaticControl" , "control" )
- activeBreadboard. select ( "controlBackprop" , FALSE )
- controlBackprop. allocateBackpropPlane ( )
- hidden1SynapseBackpropGradient. setStepSize ( 0.020000 )
-
- //
- // add weight track
- //
- activeBreadboard. stampOnAndMove ( "DataStorage" , "weightViewer" )
- dataStorage. setName ( "weightStorage" )
- weightStorage. setMessageEvery ( 12 )
- weightStorage. setBufferLength ( 1210 )
- activeBreadboard. stampOnAndMove ( "MegaScope" , "weightStorage" )
- activeBreadboard. select ( "hidden1SynapseBackprop" , FALSE )
- activeBreadboard. moveToBack ( )
- activeBreadboard. select ( "megaScope" , FALSE )
- megaScope. setAmplitude ( 0.100000 )
- megaScope. setSweepRate ( 121.000000 )
- megaScope. setName ( "weightScope" )
- weightScope. setFixWindowTitle ( TRUE )
- weightScope. setWindowTitle ( "Weight Track" )
- weightScope. openEngineWindow ( )
- weightScope.tileWindow(2,3,3,3)
- weightScope. setVerticalPosVolts ( -0.490000 )
- //
- // add box to change learning rate
- //
- runPath = macro. pathFromMacro ( "..\make edit box.nsm" )
- activeBreadboard. runMacro ( runPath )
- activeBreadboard. moveSelectionBy ( 450 , 200 )
- newTextBox. setName("learnRateTextBox")
- newEditBox. setName("learnRateEditBox")
- learnRateTextBox. setText("Lrn Rate")
- learnRateEditBox. setText("0.02")
- learnRatePath=macro. pathFromMacro("change lr.nsm")
- learnRateEditBox. setMacroPath(learnRatePath)
- activeBreadboard. select(NULL, FALSE)
-
- activeBreadboard. stampOnAndMove ( "ArrowEngine" , "weightScope" )
-
- //
- // fill in text
- //
- TextBoxPath = macro. pathFromMacro("textbox1.txt")
- NextMacroPath = macro. pathFromMacro ( "3 show rattling.nsm" )
- nextButton. setMacroPath ( NextMacroPath )
- CancelMacroPath= macro.pathFromMacro("..\minimize.nsm")
- cancelButton. setMacroPath ( CancelMacroPath)
- TitleIndex = titleTextBox. setTextFromFile (TextBoxPath, TitleIndex)
- SubtitleIndex = subtitleTextBox. setTextFromFile (TextBoxPath, SubtitleIndex)
- MainIndex = mainTextBox. setTextFromFile (TextBoxPath, MainIndex)
- //activeBreadboard. unlockWindowUpdate()
-